<script type="text/javascript" language="javascript">
var xmlHttp //Ambil XML HTTP untuk berbagai browser
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
// ================================================================================== showKabOr(str) == start
function showKab(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
	{
	 alert ("Browser does not support HTTP Request")
	 return
	}
	var url="<?php echo site_url().'backend/marketing/ajax_showKab'?>";
	url=url+"/"+str;
	//url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChangedb;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChangedb() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")		{ 
		document.getElementById("kab").innerHTML=xmlHttp.responseText 
	} 
}
// ================================================================================== showKabOr(str) == finish

</script>


<script type="text/javascript">
      $(document).ready(function() {
        setTimeout(function(){
          $("#kotak").fadeOut("slow", function () {
            $("#kotak").remove();
          });    
        }, 3000);
      });
</script>
<style type="text/css">
      #kotak {
        width: 200px;
        height: 20px;
      }
</style>
<div class="left"></div>
<div class="right"></div>
<div class="heading">
	<h1 style="background-image: url('<?php echo base_url()?>assets/images/order.png');">Sales</h1>
</div>
<div class="yui-gc wrapper">
<h1>Marketing <?php echo $row->nm_marketing;?></h1>
<?php echo $this->session->flashdata('message_type');?>
<form action="" method="post" enctype="multipart/form-data">
    <div class="yui-u first">
        <fieldset>
		<legend>Edit Marketing</legend>
		<ul>
			<li>
				<label for="nm_marketing">Nama Marketing</label>
				<?php echo form_error('nm_marketing', '<div class="error">', '</div>'); ?>
				<input type="text" name="nm_marketing" class="text" value="<?php echo $row->nm_marketing; ?>">
			</li>
			<li>
				<label for="code_marketing">Code Marketing</label>
				<?php echo form_error('code_marketing', '<div class="error">', '</div>'); ?>
				<input type="text" name="code_marketing" class="text" value="<?php echo $row->code_marketing; ?>">
			</li>
			<li>
				<label for="address">Alamat</label>
				<?php echo form_error('address', '<div class="error">', '</div>'); ?>
				<input type="text" name="address" class="text" value="<?php echo $row->address; ?>">
			</li>
			<li>
				<label for="id_province">Provinsi</label>
				<?php echo form_error('id_province', '<div class="error">', '</div>'); ?>
				<?php echo provDropdown($row->id_province);	?>
			</li>
			<li>
				<label for="id_kab">Kabupaten</label>
				<?php echo form_error('id_kab', '<div class="error">', '</div>'); ?>
				<div id='kab'><?php echo kabDropDown($row->id_province,$row->id_kab); ?></div>
			</li>
			<li>
				<input type="hidden" name="id_marketing" value="<?php echo set_value('id_marketing'); ?>">
				<input type="submit" value="Simpan"> atau <?php echo anchor('backend/marketing','Batalkan')?>
			</li>
		</ul>
    </fieldset>
    </div>
</form>
</div>